package com.example.tongue.Test.Json;

import com.alibaba.fastjson.JSON;

public class JsonTest {
    public static void main(String[] args){
        //haha是Test类没有的
        String jsonString = "{name:'hqz',age:'18',sex:'male',haha:'sd'}";
        /**
         * JSON字符串转化成自己的实体类对象 test
         */
        model model= JSON.parseObject(jsonString, model.class);
        System.out.println(model.toString());

        /**
         * 对象转化成JSON 字符串
         */
        String jsonStr = JSON.toJSONString(model);
        System.out.println(jsonStr);
    }
}